package com.duobaoyu.dby.supply.biz.client.resource.bean.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName AreaBindDTO
 * @createTime 11:37:00 2023/10/08
 */
@Data
public class AreaBindDTO implements Serializable {

    private static final long serialVersionUID = -2437430548430450157L;
    /**
     * 渠道编号
     */
    @NotBlank(message = "渠道编号不能为空")
    private String channelCode;
    /**
     * 供应链地址
     */
    @Valid
    @NotNull(message = "本地地址信息不能为空")
    private AddressBind supplyAddress;
    /**
     * 渠道地址
     */
    @Valid
    @NotNull(message = "渠道地址信息不能为空")
    private AddressBind channelAddress;
    /**
     * 标记
     */
    private Boolean mark;
    /**
     * true - 自动绑定;false - 手动绑定;
     */
    private Boolean isAutoBind;
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class AddressBind {
        /**
         * 省Id
         */
        @NotNull(message = "省地址ID不能为空")
        private Long provinceId;
        /**
         * 市Id
         */
        @NotNull(message = "市地址ID不能为空")
        private Long cityId;
        /**
         * 区Id
         */
        private Long countyId;
        /**
         * 镇ID
         */
        private Long townId;
    }
}
